package com.cusc.module_monitor_location.mvvm.model;

import android.app.Application;

import com.cusc.lib_api.RetrofitManager;
import com.cusc.lib_api.bean.RespDTO;
import com.cusc.lib_api.bean.department.NodeDepartment;
import com.cusc.lib_api.bean.department.request.Req_department;
import com.cusc.lib_api.http.RxAdapter;
import com.cusc.lib_api.services.DepartmentServices;
import com.tcgroup.phone.base_core.framework.mvvm.netregister.BaseNetRegister;

import java.util.ArrayList;

import io.reactivex.Observable;

/**
 * 作者: wangfei
 * 创建时期: 2020/4/3.
 * 包名: com.cusc.module_monitor_location.mvvm.model
 * 类名: OSAndroidMvvm
 */
public class LocationMonitorRegister extends BaseNetRegister {

    DepartmentServices mDepartmentServices;

    public LocationMonitorRegister(Application mApplication) {
        super(mApplication);
        mDepartmentServices = RetrofitManager.getInstance().getDepartmentService();
    }


    public Observable<RespDTO<ArrayList<NodeDepartment>>> getDepartmentToBus(Req_department department){
        return mDepartmentServices
                .getDepartmentToBus(department)
                .compose(RxAdapter.schedulersTransformer())
                .compose(RxAdapter.exceptionTransformer());
    }

}
